<div id="menus-block">
<?php

foreach ( $links as $link ):

if ($link['type']=='section'):
	$h3 = tool::remap( $link, array( 'text', 'title', 'href' => 'url' ) );
	echo html_element( 'h3', array( 'html' => html_a( $h3 ) ) );
	continue;
endif;

?><ul class="menus-section-block"><?php

	?><li class="type-<?php echo $link['type']; ?> <?php echo $link['selected'] ? 'selected' : ''; ?>"><?php

		$anchor = tool::remap( $link, array( 'text', 'title', 'href' => 'url' ) );
		if ($link['selected'])
			$anchor['class'] = (isset($anchor['class']) ? $anchor['class'] : '') . 'selected';

		echo html_a($anchor);

	?></li><?php

?></ul><?php

endforeach;

?>
</div>
